<?php
session_start();
require('check_login.php');
include(dirname(__FILE__) . '/config.php');
require('header.php');
require('contacts_lib.php');
$ids = $_POST['id'];

$contacts=get_all_contacts($ids);
$contacts_arr=array();
foreach($contacts as $contact){
$contacts_arr[]=$contact['email'];
}

$string_emails= implode(",", $contacts_arr);
$string_emails = trim($string_emails, ',');

?>

<!-- BEGIN CONTAINER -->
<div class="page-container">
	<!-- BEGIN SIDEBAR -->
	<?php require_once('left_menu.php'); ?>
	
	<!-- END SIDEBAR -->
	<!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			
			<!-- /.modal -->
			<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- BEGIN STYLE CUSTOMIZER -->
			
			<!-- END STYLE CUSTOMIZER -->
			<!-- BEGIN PAGE HEADER-->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<ul class="page-breadcrumb breadcrumb">
						<li>
							<i class="fa fa-home"></i>
							<a href="index.php">
								Trang chủ
							</a>
							<i class="fa fa-angle-right"></i>
						</li>
						<li>
							<a href="#">
								Màn hình quản trị
							</a>
							<i class="fa fa-angle-right"></i>
						</li>
						<li>
							<a href="#">
								Soạn thư
							</a>
						</li>
						
					</ul>
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<div class="row inbox">
				<div style="display:none">
					<ul class="inbox-nav margin-bottom-10">
						<li class="compose-btn">
							<a id="compose_id_link" href="javascript:;" data-title="Compose" class="btn green">
								<i class="fa fa-edit"></i> Soạn thư
							</a>
						</li>
										
						
						
					</ul>
				</div>
				<div class="col-md-12">
					
					
					<div class="inbox-content">
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<?php 
require_once('footer.php');
require_once('common_script.php');
?>


<script src="assets/scripts/core/app.js"></script>
<script src="assets/scripts/custom/inbox.js"></script>
<script>
jQuery(document).ready(function() {       
   // initiate layout and plugins
   App.init();
   Inbox.init();
   
   $("#compose_id_link").trigger('click');
   $('#to').val('<?php echo  $string_emails ?>');
   
});
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>